﻿using Microsoft.AspNetCore.Mvc;
using mozhi.smarterp.AuthorCenter.Users;
using mozhi.smarterp.AuthorCenter.Users.Permissions;
using System.Threading.Tasks;
using System;
using Volo.Abp;

namespace mozhi.smarterp.AuthorCenter.Controllers
{
    [RemoteService]
    public class UserDataPermissionController : AuthorCenterController
    {
        private ICustomIdentityUserAppService _appService;

        public UserDataPermissionController(ICustomIdentityUserAppService appService)
        {
            _appService = appService;
        }

        [HttpGet]
        [Route("api/identity/users/{id}/data-permission")]
        public async Task<UserDataPermissionDto> GetDataPermissionAsync(Guid id)
        {
            return await _appService.GetDataPermissionAsync(id);
        }
    }
}
